package com.codeduck.kafka.event.message;

import com.codeduck.kafka.pojo.TopicHandler;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.clients.consumer.ConsumerRecords;

public class MessageInfo {
    /**
     * 消息处理者
     */
    private final TopicHandler msgHandler;

    /**
     * 消息记录
     */
    private  ConsumerRecord<Object, Object> record;
    private  ConsumerRecords<Object, Object> records;

    public MessageInfo(TopicHandler handler, ConsumerRecord<Object, Object> record) {
        this.msgHandler = handler;
        this.record = record;
    }

    public MessageInfo(TopicHandler handler, ConsumerRecords<Object, Object> records) {
        this.msgHandler = handler;
        this.records = records;
    }

    public TopicHandler getMsgHandler() {
        return msgHandler;
    }

    public ConsumerRecord<Object, Object> getRecord() {
        return record;
    }

    public ConsumerRecords<Object, Object> getRecords() {
        return records;
    }
}
